<template>
  <el-cascader
    v-bind="$attrs"
    :options="cityData"
    :props="{ value: 'cityId', checkStrictly: true }"
    placeholder="所属城市"
    filterable
    clearable
    v-on="$listeners">
    <template slot-scope="{ node, data }">
      <span>{{ data.label }}</span>
      <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
    </template>
  </el-cascader>
</template>

<script>
import adminUtilMng from '@/api/system/AdminUtilMng'

export default {
  components: { },
  props: {
  },
  data() {
    return {
      cityData: []
    }
  },
  created() {
    adminUtilMng.getAllCityData().then(res => {
      this.cityData = res.data
    })
  },
  methods: {
    selectUser() {
      const _this = this.$refs.userSelectList
      _this.loadData()
      _this.dialog = true
    },
    userSelectCallback(selectedRow, userSelectObj) {
      this.$emit('userSelectCallback', selectedRow, userSelectObj)
    }
  }
}
</script>
